package code

import (
	"context"
	"fmt"

	"github.com/docker/docker/api/types/image"
)

// 列出所有镜像
func ListImage() {
	cli := InitClient()

	ctx := context.Background()

	images, err := cli.ImageList(ctx, image.ListOptions{})
	if err != nil {
		panic(err)
	}

	for _, image := range images {
		fmt.Printf("image: %#v\n", image)
	}
}
